//
//  AppLocationManager.h
//  YYDemo
//
//  Created by lipeng on 2019/4/20.
//  Copyright © 2019 lipeng. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@class AppLocationManager;
typedef void(^uplocationBlock)(NSArray *locations,AppLocationManager *locationManager);
typedef void(^failBlock)(NSError *error);
/**
 地理位置管理
 */
@class CLLocationManager;
@class CLRegion;
@class CLLocation;
@interface AppLocationManager : NSObject
/* 应用内启动地理位置变更 成功回调*/
@property (nonatomic,copy) dispatch_block_t statusBlock;
/* 失败回调 */
@property (nonatomic,copy) failBlock  errorBlock;
/* 获取地理位置数组 */
@property (nonatomic,copy) uplocationBlock locationBlock;
/* 敏感地址 */
@property (nonatomic,strong,setter=setRegion:) CLRegion *region;
/* 当前地址:String */
@property  NSString *address;
/* 当前地理位置:CLLocation*/
@property (nonatomic, getter=currentLocation) CLLocation *curLocation;
/* 地理位置反解析:YES:需要,NO:不需要;默认为NO */
@property (nonatomic,assign,setter=setReverseGeocoder:) BOOL needReverseGeocode;

#pragma mark - 位置相关

- (CLLocationManager *)setupLocation;

- (void)stopLocation;

- (void)localtionAddress;

#pragma mark - 位置解析

- (void)geocoderFromDictionary:(NSDictionary *)addressDic;
- (void)geocoderFromAddString:(NSString *)address;

@end

NS_ASSUME_NONNULL_END
